/**
 * *******************************************
 * user: zmq
 * describe:   消息返回接口 封装处理
 * created:
 * date: 2021/8/31
 * *******************************************
 */

import {IServerRes} from "../consts/interface";

export class MessagePack {

    // 成功返回
    public static successResult(result: any) {
        return {
            code: 0,
            data: result
        };
    };

    // 失败返回
    public static failResult(errorCode : IServerRes) {
        return {
            code: errorCode.code,
            message: errorCode.errStr
        };
    };
}